package me.cabbit.digitone.gui;

import org.w3c.dom.Element;

/**
 * This class is basically a simple XML Element wapper for a preset
 * This allows me to directly add the XML Element to the combobox, so I can
 * easily reference them later for save / delete 
 *
 * @author Arkaid
 */ 
class Preset {
	
	//------------------------------------------------------------------//
	//--------------------------- properties ---------------------------//
	//------------------------------------------------------------------//

	/** XML Element this class wraps */
	private Element source;
		
	//------------------------------------------------------------------//
	//----------------------------- methods ----------------------------//
	//------------------------------------------------------------------//

	/**
	 * Constructor
	 * @param source the XML element to wrap. The element containts 
	 * the preset information.
	 */
	public Preset(Element source) 
	{
		this.source = source;
	}
	
	/**
	 * Gets the wrapped XML element
	 * @return the wrapped XML element
	 */
	public Element getXMLElement() 
	{
		return this.source;
	}
	
	/**
	 * Gets the preset's screentone's unique id
	 * @return unique id of the screentone for this preset
	 */
	public String getUID() {
		return this.source.getAttribute("uid");
	}

	@Override
	public String toString() {
		return this.source.getAttribute("name");
	}
}
